<?
require("config.php");

$show_backnav = "product_menu";
$location_status .= "| Delete";

$menuname = array(
	"Info",
	"Pictures"
);

$menutarget = array(
	"delete",
	"delete_pictures"
);

$menutype = 2;

if (NULL!=$action){

   $Query = "delete from $table where id=$id Limit 1";

   myQuery($Query);


   header("location:" . $rela_path . "share/msg.php?v=3&Start_Num=$Start_Num");

   exit();

}


if (!checkRecord($table,$id)){

	header("location:" . $rela_path . "share/msg.php?v=9002");
  
}


$Query = "select 
	code,
	name,
	description,
	unit,
	brand,
	type,
	category,
	fabric,
	price_euro,
	price_gbp,
	price_hkd,
	price_usd,
	remark,
	auth,
	size,
	mark_new,
	publish ,
	weight,
	reorder,
	stock,
	issuedate,
	sn_en,
	sn_cn,
	updatetime
from pro_basic where id=$id Limit 1";

$r = myQuery($Query);

$Code=$r[0][0];
$Name=$r[0][1];
$Description=$r[0][2];
$Unit=$r[0][3];
$CName=$r[0][4];
$Type=$r[0][5];
$Category=$r[0][6];
$Fabric=$r[0][7];
$Price_euro=$r[0][8];
$Price_gpb=$r[0][9];
$Price_hkd=$r[0][10];
$Price_usd=$r[0][11];
$CDescription =$r[0][12];
$Auth =$r[0][13];
$Size =$r[0][14];
$Mark_new =$r[0][15];
$Publish =$r[0][16];
$weight =$r[0][17];
$reorder =$r[0][18];
$stock =$r[0][19];
$issue =$r[0][20];

$sn_en = $r[0][21];
$sn_cn = $r[0][22];
$updatedate=$r[0][23];



if ($issue < strtotime('1980-01-01 00:00:00')) {
	$issuedate='N/A';
}
else {
	$issuedate=date('Y-m-d',$issue);
}
if ($updatedate < strtotime('1980-01-01 00:00:00')) {
	$updatedate='N/A';
}
else {
	$updatedate=date('Y-m-d',$updatedate);
}

	$P_str='';
	$level=1;	
	
	while ($level>0 && $Category!='0') {
		$Query = "select id, code, name, logo, parent,product,sort,level from pro_category where id = $Category";
		$r = myQuery($Query);
		$Category = $r[0][4];
		$pname	= $r[0][2];
		if ($P_str) $P_str= $pname.' > '.$P_str;
			else $P_str= $pname;
		$level= $r[0][7];
	}

/*
$Query = "select code, name from pro_brand";
$brands = myQuery($Query);

$Query = "select code, name from pro_type";
$types = myQuery($Query);


$Query = "select code, name from pro_category";
$categorys = myQuery($Query);
*/


require($rela_path . "inc/header.php");

?>

<!--Content Start-->
<form action="" method="post" enctype="multipart/form-data" name="form1">  
<!--hidden filed-->
<input name="id" type="hidden" value="<?print($id)?>">
<input name="action" type="hidden" value="add">

  <table width="95%" border="0" align="center">
                      <tr> 
                        
      <td>&nbsp; </td>
                      </tr>
                      <tr> 
                        
      <td><strong>Are you sure to delete this product ?</strong> <input type="Submit" class="button" name="Button" value="   Yes   "> 
        <input type="button" class="button" name="Submit2" value="   No   " onClick="Redirect('product_menu.php?Start_Num=<?=$Start_Num?>',1);"> 
        <br>
        <br>
        <table border="0">
          <tr>
            <td class="tdheader">Code :</td>
            <td width="350"><?print($Code)?></td>
            <td width="350">&nbsp;</td>
          </tr>
          <tr>
            <td class="tdheader">Publish:</td>
            <td>
              <?
if ($Publish==0) echo "No";
if ($Publish==1) echo "Yes";
?>
            </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="tdheader">Name :</td>
            <td><?print($Name)?></td>
            <td><?=$CName?></td>
          </tr>
          <tr>
            <td class="tdheader">Description :</td>
            <td><?print($Description)?></td>
            <td><?=$CDescription?></td>
          </tr>
		  <tr> 
            <td class="tdheader">Special Note :</td>
            <td><?=$sn_en?></td>
            <td><?=$sn_cn?></td>
          </tr>
          <tr>
            <td class="tdheader">Weight :</td>
            <td><?=$weight?>
      Kg </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="tdheader">Re-order :</td>
            <td><?=$reorder?></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="tdheader">Current Stock Level :</td>
            <td><?=$stock?></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="tdheader">Category :</td>
            <td colspan="2"><?=$P_str?></td>
          </tr>
          <tr>
            <td valign=top class="tdheader">Price : </td>
            <td colspan="2">
              <TABLE>
                <TR>
                  <TD>Normal</TD>
                  <TD align=right><?print($Price_euro)?></TD>
                </TR>
                <TR>
                  <TD>Special</TD>
                  <TD align=right><?print($Price_gpb)?></TD>
                </TR>
                <TR>
                  <TD>Member</TD>
                  <TD align=right><?print($Price_hkd)?></TD>
                </TR>
                <TR>
                  <TD>VIP</TD>
                  <TD align=right><?print($Price_usd)?></TD>
                </TR>
            </TABLE></td>
          </tr>
          <tr>
            <td class="tdheader">Issue Date : </td>
            <td><?=$issuedate?></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td class="tdheader">Update Date : </td>
            <td><?=$updatedate?></td>
            <td>&nbsp;</td>
          </tr>
        </table>
        <p>&nbsp;</p>
        <p>&nbsp;</p></td>
                      </tr>
                    </table>
</form>
            <!--Content End-->
            <?
require($rela_path . "inc/footer.php");
?>
        